import UIKit

var str = "Hello, playground"

//定义枚举
enum State{
    case loading,suc,err,empty
}

//使用枚举
var state:State = State.empty

print(state)

//如果变量已经确认为某个枚举类型，赋值可以这样写
state = .loading

//为枚举关联一个值
enum State2:String{
    case loading = "加载中"
    case suc = "成功"
    case err = "数据错误"
    case empty = "无数据"
}

var state_2 = State2.loading

print(state_2.rawValue)
